package GameObjects;

import org.jbox2d.dynamics.BodyDef;
import org.jbox2d.dynamics.World;
import org.mt4j.MTApplication;
import org.mt4j.util.MTColor;
import org.mt4j.util.math.Vector3D;

import Controller.Player;
import advanced.physics.physicsShapes.PhysicsRectangle;
/**
 * Class for the PlayerBrick of FingerBreak
 * @author Marco Bierbach
 *
 */
public class PlayerBrick extends PhysicsRectangle{

	Player playerAffinity;
	
	public PlayerBrick(Vector3D vector3d, int width, int height, MTApplication app,
			World world, int density, int friction, int restitution, float scale) {
		super(vector3d, width, height, app, world, density, friction, restitution, scale);
	}
	
	public PlayerBrick(Vector3D vector3d, int width, int height, MTColor _color, MTApplication app, World world, float scale){
		super(vector3d, width, height, app, world, 10, 0, 1, scale);
		setFillColor(_color);
	}
	
	/**
	 * 
	 * Method to keep the physicshape of the infobox rigid and avoid the wild curving around the Touchpoint.
	 * Also added the frictioneffekt with lineardamping the velocityforce.
	 * 
	 */
	protected void bodyDefB4CreationCallback(BodyDef def) 
	{
		super.bodyDefB4CreationCallback(def);
		def.fixedRotation = true;
	}
	
	/**
	 * Settermethod for the playeraffinity
	 * @param _playerAffinity
	 */
	public void setPlayerAffinity(Player _playerAffinity){
		playerAffinity = _playerAffinity;
	}
	
	/**
	 * Gettermethod for the playeraffinity
	 * @return
	 */
	public Player getPlayerAffinity(){
		return playerAffinity;
	}

}
